type CalcType = (num1: number, num2: number) => number

function calc(n1: number, n2: number, fn: CalcType) {
    return fn(n1, n2)
}


const res1 = calc(10, 20, (a, b) => {
    return a + b
})

const res2 = calc(10, 20, (a, b) => {
    return a - b
})

const res3 = calc(10, 20, (a, b) => {
    return a * b
})

const res4 = calc(10, 20, (a, b) => {
    return a / b
})

const add: CalcType = (n1, n2) => {
    return n1 + n2
}
add(12, 33)

export {}